﻿using System.Linq;

namespace Unijovem.Domain
{
    public partial class NewsLetter
    {
        public bool EmailCadastrado
        {
            get { return Context.Instance.NewsLetters.Any(n => n.Email == Email && n.DataExclusao == null); }
        }

        public NewsLetter SelecionarPorEmail (string email)
        {
            return Context.Instance.NewsLetters.FirstOrDefault(n => n.Email == email && n.DataExclusao == null);
        }
    }
}
